package com.luxsoft.siipap.em.replica.ui;

import ca.odell.glazedlists.BasicEventList;
import ca.odell.glazedlists.EventList;
import ca.odell.glazedlists.GlazedLists;

import com.luxsoft.siipap.em.replica.model.Registro;
import com.luxsoft.siipap.em.replica.online.OnLineImportManager;

public class ReplicaViewModel {
	
	private EventList<Registro> registros;
	
	
	public ReplicaViewModel(){
		initGlazedLists();
	}
	
	private void initGlazedLists(){
		registros=GlazedLists.threadSafeList(new BasicEventList<Registro>());
	}
	
	public void loadRegistros(){
		registros.addAll(OnLineImportManager.getInstance()
				.getReplicationManager()
				.buscarRegistros());
	}

	public EventList<Registro> getRegistros() {
		return registros;
	}
	
	/*public void procesarRegistro(Registro r) throws Exception{
		EMServiceLocator.getReplicationManager().procesar(r);
	}
	*/
	 
	

}
